package com.cn.integration.business.usercenter.controller;

import com.cn.common.annotation.Auth;
import com.cn.common.model.Result;
import com.cn.integration.business.usercenter.dto.LoginDto;
import com.cn.integration.business.usercenter.service.UserService;
import com.cn.integration.common.BaseController;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/web/ump/user")
public class UserController extends BaseController {

    @Resource
    private UserService userService;

    @Auth
    @PostMapping("/login")
    public Result login(@RequestBody @Valid LoginDto dto) {
        return Result.success(userService.login(dto));
    }

}
